package com.tinem.platform.service.message;

import com.baidu.fsg.uid.annotation.EnableCacheUid;
import com.tinem.platform.module.starter.annotation.EnableEmqx;
import com.tinem.platform.module.starter.annotation.EnableMqtt;
import com.tinem.platform.module.starter.jms.annotation.EnableJms;
import com.tinem.platform.module.starter.jpa.annotation.EnableJpa;
import com.tinem.platform.module.starter.sdk.annotation.EnableMessage;
import com.tinem.platform.module.starter.token.annotation.EnableToken;
import com.tinem.platform.module.starter.web.annotation.EnableGatewayContext;
import com.tinem.platform.module.starter.web.annotation.EnableWeb;
import com.tinem.platform.module.starter.web.config.FeignConfiguration;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;

/**
 * @author fengzhihao
 * @version v1
 * @program: platform
 * @className TokenApplication
 * @description TODO
 * @site 
 * @company 
 * @create 2020-06-18 15:55
 */
@Slf4j
@EnableWeb
@EnableJpa
@EnableJms
@EnableEmqx
@EnableMqtt
@EnableToken
@EnableMessage
@EnableCacheUid
@EnableGatewayContext
@EnableDiscoveryClient
@SpringBootApplication
@EntityScan("com.tinem.platform.service.message.entity")
@EnableJpaRepositories(basePackages = "com.tinem.platform.service.message.repository")
@EnableFeignClients(value = "com.tinem.platform.client.link",defaultConfiguration = FeignConfiguration.class)
public class MessageServiceApplication {

    public static void main(String[] args) {
        long startTime = System.currentTimeMillis();

        ConfigurableApplicationContext context = SpringApplication.run(MessageServiceApplication.class, args);

        long endTime = System.currentTimeMillis();
        System.out.println("start success; duration:("+ (endTime - startTime) +");startTime:("+startTime+");endTime:("+ endTime +")");
        log.info("start success; duration:({});startTime:({});endTime:({})",(endTime - startTime),startTime,endTime);

        }
}
